package com.zhanghe.study.design_pattern.visitor_pattern;

/**
 * 访问者模式
 * @author zh
 * @date 2022/10/24 12:04
 */
public class Main {
    public static void main(String[] args) {
        ObjectStructure objectStructure = new ObjectStructure();

        Element eleA = new ConcreteElementA();
        Element eleB = new ConcreteElementB();

        objectStructure.addElement(eleA);
        objectStructure.addElement(eleB);

        Visitor visitor = new ConcreteVisitorA();
        objectStructure.handleRequest(visitor);
    }
}
